//
//  PGIndexBannerSubiew.m
//  NewPagedFlowViewDemo
//
//  Created by Mars on 16/6/18.
//  Copyright © 2016年 Mars. All rights reserved.
//  Designed By PageGuo,
//  QQ:799573715
//  github:https://github.com/PageGuo/NewPagedFlowView

#import "PGIndexBannerSubiew.h"

@implementation PGIndexBannerSubiew

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    
    if (self) {
        [self addSubview:self.mainImageView];
        [self addSubview:self.btn];
    }
    
    return self;
}

- (UIImageView *)mainImageView {
    
    if (_mainImageView == nil) {
        _mainImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.highly-50)];
    }
    return _mainImageView;
}
- (UIButton *)btn
{
    if (_btn == nil) {
        _btn = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn.frame = CGRectMake(self.mainImageView.frame.origin.x, self.mainImageView.frame.origin.y+self.mainImageView.frame.size.height, self.mainImageView.frame.size.width, 50);
        _btn.backgroundColor = GreenColor;
        [_btn setTitle:@"进入按摩" forState:UIControlStateNormal];
        [_btn setBackgroundImage:PNGIMAGE(@"养生－美容养生back") forState:UIControlStateNormal];
    }
    return _btn;
}

@end
